package cn.broadsense.common.annotation;

import cn.broadsense.common.validator.BigDecimalRangeValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author huangjinshi
 * @description
 * @createDate 2024-09-20 10:53:51
 */
@Target({FIELD})
@Retention(RUNTIME)
@Constraint(validatedBy = BigDecimalRangeValidator.class)
public @interface BigDecimalRange {

    String message() default "数值超过区间";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    double min() default Double.MIN_VALUE;

    double max() default Double.MAX_VALUE;
}
